#pragma once
/*
 * Created by: Mark Lavrynenko
 * Email:	MarkLavrinenko@gmail.com
 * Project:	  Huffman
*/

#include "ihtreebuilder.h"
#include "HuffmanTreeNode.h"
#include "HuffmanOptions.h"

class TreeBuilder :
	public IHTreeBuilder
{
public:
	virtual HTree* buildTree(FrequencyTable* table);
private:
	// some nodes can be NULL
	HuffmanTreeNode* nodes[256];
	bool  makeStep();
	static const size_t notFound = 1000;
	size_t findMinPosition(size_t ignore = notFound);
};

